Plex configuration for NGINX
location / {
# if a request to / comes in, 301 redirect to the main plex page.
# but only if it doesn't contain the X-Plex-Device-Name header
# this fixes a bug where you get permission issues when accessing the web dashboard
if ($http_x_plex_device_name = '') {
rewrite ^/$ http://$http_host/web/index.html;
}
# set some headers and proxy stuff.
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
# include Host header
proxy_set_header Host $http_host;
# proxy request to plex server
proxy_pass http://localhost:32400;
}